/*
//	CP2013 Traffic Simulator Assignment :: (MVC) Model (Header File)
//	Copyright (c) 2010, Adam Rehn
//
//	This the main MVC Model class, which is wrapped inside the main wxWidgets GUI frame.
*/

#ifndef _MODEL_H
#define _MODEL_H

//We are using vectors
#include <vector>
using std::vector;

//Include the components of the model
#include "common.h"
#include "vehicle.h"
#include "lane.h"
#include "trafficlight.h"
#include "intersection.h"
//#include "tilemap.h"
#include "zone.h"
#include "operators.h"

//We will use this for roads
typedef vector<lane> road;

class mvcModel
{
	public:
		//Constructor and destructor
		mvcModel(simulationParams setup);
		~mvcModel();
		
		//Zones are used in lieu of tiles
		vector<zone*>    zones;
		
		//Because we are using zones, an overall rectangle must be stored
		rectangle        overallSimulationArea;
		
		//These are used to generate the map
		intersection     intSct;
		road             roadN;
		road             roadS;
		road             roadE;
		road             roadW;
		
		//This allows for easy looping through all of the roads
		road**           roads;
		
		//This keeps track of the settings
		simulationParams settings;
		
		//These are the vehicles currently in memory
		vector<vehicle>  vehicles;
		
		//Use this to determine if an area is obstructed
		bool isObstructed(rectangle& rect);
		
		//Use this to determine if a direction is supported unanimously for a given area
		bool directionSupported(rectangle& rect, direction_t dir);
};

#endif
